<template>
	<view class="container">
		<view class="tabbar">
			<view class="item" :class="{active: !tabIndex}" @tap="switchTab(0)">当前订单</view>
			<view class="item" :class="{active: tabIndex}" @tap="switchTab(1)">历史订单</view>
		</view>
		<view class="none-order-tip" >
			<image src="/static/takeorder/takeorder_nonetip.png" class="drinks-img"></image>
			<view class="none-tip">
				<view>您暂时还没有订单哦～</view>
			</view>
			<button type="primary" class="drink-btn" size="default" @tap="menu()">去点单</button>
		</view>
		<!-- <image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
		</view> -->
	</view>
</template>

<script>
	import listCell from '@/components/list-cell.vue'
	export default {
		data() {
			return {
				tabIndex: 0,
				orders: [],
			}
		},
		onLoad() {

		},
		methods: {
			switchTab(index) {
				if(this.tabIndex === index) return
				this.tabIndex = index
				// if(this.tabIndex) {
				// 	this.getOrders()
				// }
			},
			menu() {
				uni.switchTab({
					url: '/pages/order/order'
				})
			},
			getOrders() {
				//获取订单api
				if(!this.orderMenuIndex) {
					this.orders = this.$api('orders')
				}else{
					
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	/* #ifdef H5 */
	page {
		min-height: 100%;
		background-color: $bg-color;
	}
	/* #endif */
	.tabbar {
		height: 100rpx;
		background-color: $bg-color-white;
		display: flex;
		align-items: center;
		justify-content: space-around;
		
		.item {
			height: 100%;
			font-size: $font-size-lg;
			color: $text-color-assist;
			font-weight: 400 !important;
			display: flex;
			align-items: center;
			
			&.active {
				color: $color-primary;
				border-bottom: 4rpx solid $text-color-base;
			}
		}
	}
	.none-order-tip{
		display: flex;
		align-items: center;
		flex-direction: column;
		justify-content: center;
		margin-top: 50rpx;
		
		.drinks-img {
			// display: flex;
			// justify-content: center;
			// align-items: center;
			width: 200rpx;
			height: 200rpx;
		}
		
		.drink-btn {
			align-items: center;
			width: 320rpx;
			border-radius: 50rem !important;
			margin-bottom: 40rpx;
			font-size: $font-size-base;
			line-height: 3.0;
			color: $color-primary;
			margin-top: 45rpx;
		}
	
		.none-tip{
			// justify-content: center;
			// align-items: center;
			// display: flex;
			// flex-direction: column;
			size: $font-size-base;
			color:$text-color-assist;
		}
	}

	.tips {
		margin: 60rpx 0 80rpx;
		line-height: 48rpx;
	}

	// .content {
	// 	display: flex;
	// 	flex-direction: column;
	// 	align-items: center;
	// 	justify-content: center;
	// }
	
	
</style>